package com.umpay.feign.client;


import java.util.Map;

import com.umpay.dict.XmlData;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.umpay.config.FeignLogConfiguration;
import com.umpay.dto.UMFResponse.Message;
import com.umpay.dto.memberMgr.req.BindBankAccountReq;
import com.umpay.dto.memberMgr.req.MemberPayAgreementsReq;
import com.umpay.dto.memberMgr.req.MemberQualExamReq;
import com.umpay.dto.memberMgr.req.MemberQueryReq;
import com.umpay.dto.memberMgr.req.MemberRegisterReq;
import com.umpay.dto.memberMgr.req.MemberSuppAccountReq;
import com.umpay.dto.memberMgr.req.MerConvertReq;
import com.umpay.dto.memberMgr.req.SaveBankCardInfReq;
import com.umpay.dto.memberMgr.reqdep.DepCorpRegisterAndBindAccountReq;
import com.umpay.dto.memberMgr.res.BindBankAccountRes;
import com.umpay.dto.memberMgr.res.CardBinSearchRes;
import com.umpay.dto.memberMgr.res.MemberPayAgreementsRes;
import com.umpay.dto.memberMgr.res.MemberQueryRes;
import com.umpay.dto.memberMgr.res.MemberRegisterRes;
import com.umpay.dto.memberMgr.res.MerBusiAgreementQueryRes;
import com.umpay.dto.memberMgr.res.MerCertRes;
import com.umpay.dto.memberMgr.res.MerConvertRes;
import com.umpay.dto.memberMgr.res.QryMerPayServiceRes;
import com.umpay.dto.memberMgr.res.QryMerPproductRelRes;
import com.umpay.dto.memberMgr.res.QryMerPproductSupportBankListRes;
import com.umpay.dto.memberMgr.res.SaveBankCardInfRes;
import com.umpay.dto.memberMgr.resdep.DepCorpRegisterAndBindAccountRes;
import com.umpay.feign.hystrix.MemberDomainServerFeignClientHystrix;

/**
 * @ClassName: MemberDomainServerFeignClient  
 * @Description: 远程调用用户管理接口  
 * @author zhangtao  
 * @date Jan 23, 2018
 */
@FeignClient(name = "memberDomain", configuration = FeignLogConfiguration.class, fallbackFactory = MemberDomainServerFeignClientHystrix.class)
public interface MemberDomainServerFeignClient {
        
    /**
     * @Title: qryMerBproductInf  
     * @Description: 商户业务产品查询
     * @param @param 
     * @param @return    参数  
     * @return Message<MerBusiAgreementQueryRes>    返回类型  
     * @throws
     */
    @RequestMapping(value = "memberDomain/v1/mer/merBusiAgreenetInfo/{merId}/{bProductId}", method = RequestMethod.GET)
    @Cacheable(value = XmlData.CACHE_MERCHANT_BPRODUCT, key = "'mer_bp_'+#p0+'_'+#p1")
    public Message<MerBusiAgreementQueryRes> qryMerBproductInf(@PathVariable("merId") String merId, @PathVariable("bProductId") String bProductId, @RequestParam("rpid") String rpid);
    
    /**
     * @Title: merPProductQuery  
     * @Description: 商户支付产品查询  
     * @param @param 
     * @return Message<QryMerPproductRelRes>    返回类型  
     * @throws
     */
    @RequestMapping(value = "/memberDomain/v1/mer/merPproductInfo/{merId}/{pProductId}", method = RequestMethod.GET)
    @Cacheable(value = XmlData.CACHE_MERCHANT_PPRODUCT, key = "'mer_pp_'+#p0+'_'+#p1")
    public Message<QryMerPproductRelRes> qryMerPproductIdRel(@PathVariable("merId") String merId, @PathVariable("pProductId") String pProductId, @RequestParam("rpid") String rpid);
    
    /**
     * @Title: getMerInfo  
     * @Description: 查询商户信息
     * @param @param merId
     * @return Message<MerInfRes>   返回类型  
     * @throws
     */
//    @RequestMapping(value = "/memberDomain/v1/mer/merInfo/{merId}", method = RequestMethod.GET)
//    @Cacheable(value = XmlData.CACHE_MERCHANT_INF, key = "'merId_'+#p0")
//    public Message<MerInfRes> getMerInfo(@PathVariable("merId") String merId,@RequestParam("rpid") String rpid);
    
    
    @RequestMapping(value = "/memberDomain/v1/member/memberReg", method = RequestMethod.POST)
    public Message<MemberRegisterRes> memberRegister(@RequestBody MemberRegisterReq member);
    
    
    @RequestMapping(value = "/memberDomain/v1/member/memberSuppAcc", method = RequestMethod.POST)
    public Message<MemberSuppAccountReq> memberSuppAcc(@RequestBody MemberSuppAccountReq member);
    
    /**
     * @Title: getMemberInfo  
     * @Description: 查询会员信息  
     * @param @param member
     * @return Body<MemberRes>    返回类型  
     * @throws
     */
    @RequestMapping(value = "/memberDomain/v1/mermeber/memberInfo/", method = RequestMethod.POST)
    public Message<MemberQueryRes> getMemberInfo(@RequestBody MemberQueryReq memberQueryReq);
    /**
     * @Title: getMemberPayAgreemeetsInf  
     * @Description: 查询用户支付协议
     * @param @param
     * @return Message<MemberPayAgreementsRes>    返回类型  
     * @throws
     */
    @RequestMapping(value = "/memberDomain/v1/mermeber/getMemberPayAgreemeetsInf/", method = RequestMethod.POST)
    public Message<MemberPayAgreementsRes> getMemberPayAgreemeetsInf(@RequestBody MemberPayAgreementsReq memberPayAgreementsReq);
    /**
     * @Title:qryPproductSupportBankList  
     * @Description: 查询支付产品支持银行列表
     * @param @param 
     * @return Message<QryMerPproductSupportBankListRes>    返回类型  
     * @throws
     */
    @RequestMapping(value = "/memberDomain/v1/mer/merPproductSupportBankList/{merId}/{pProductId}", method = RequestMethod.GET)
    @Cacheable(value = XmlData.CACHE_MERCHANT_BANKLIST, key = "'mer_bl_'+#p0+'_'+#p1")
    public Message<QryMerPproductSupportBankListRes> qryPproductSupportBankList(@PathVariable("merId") String merId, @PathVariable("pProductId") String pProductId, @RequestParam("rpid") String rpid);
    
    /**
     * @Title: getCardBinInfo  
     * @Description: 卡bin查询 
     * @param @param 
     * @return Message<CardBinSearchRes>    返回类型  
     * @throws
     */
    @RequestMapping(value = "/memberDomain/v1/cardBin/cardBinInfo/", method = RequestMethod.POST)
    public Message<CardBinSearchRes> getCardBinInfo(Map<String, String> reqMap);
    
    /**
     * @Title: bindBankAccount  
     * @Description: 会员绑定银行账号 
     * @param @param 
     * @param @return    参数  
     * @return Message<BindBankAccountRes>    返回类型  
     * @throws
     */
    @RequestMapping(value = "/memberDomain/v1/mermeber/memberCardBind/", method = RequestMethod.POST)
    public Message<BindBankAccountRes> bindBankAccount(@RequestBody BindBankAccountReq bindBankAccountReq);

    @RequestMapping(value = "/memberDomain/v1/member/QualExam", method = RequestMethod.POST)
    public Message<MemberQualExamReq> updateMemberQuelState(@RequestBody MemberQualExamReq memberQualExamReq);

    @RequestMapping(value = "/memberDomain/v1/member/corpMemberDepBankReg", method = RequestMethod.POST)
    public Message<DepCorpRegisterAndBindAccountRes> merMemberReg(@RequestBody DepCorpRegisterAndBindAccountReq depCorpRegisterAndBindAccountReq);

    @RequestMapping(value = "/memberDomain/v1/mermeber/saveBankCardInf/", method = RequestMethod.POST)
	public Message<SaveBankCardInfRes> recordCard(@RequestBody SaveBankCardInfReq saveBankCardInfReq);
      
    @RequestMapping(value = "/memberDomain/v1/mer/merCert/{merId}/{serviceId}", method = RequestMethod.GET)
    @Cacheable(value = XmlData.CACHE_BANK_MER_CERT, key = "'mer_cert_'+#p0+'_'+#p1")
	public Message<MerCertRes> getMerCert(@PathVariable("merId") String merId, @PathVariable("serviceId") String serviceId, @RequestParam("rpid") String rpid);
   
    @RequestMapping(value = "/memberDomain/v1/mer/merConvert", method = RequestMethod.POST)
    @Cacheable(value = XmlData.CACHE_BANKMERID, key = "'mer_bank_id_'+#p0.merId+'_'+#p0.serviceId")
	public Message<MerConvertRes> qryMerConvert(@RequestBody MerConvertReq merConvertReq);
    
    @RequestMapping(value = "/memberDomain/v1/mer/merPayService/{merId}/{pProductId}", method = RequestMethod.GET)
    @Cacheable(value = XmlData.CACHE_MERPAYSERVICE, key = "'mer_ser_'+#p0+'_'+#p1")
    public Message<QryMerPayServiceRes> qryMerPayService(@PathVariable("merId") String merId, @PathVariable("pProductId") String pProductId, @RequestParam("rpid") String rpid);
}
